package com.cloud.test.usercustomerfegionhystrix.controller;

import com.cloud.test.usercustomerfegionhystrix.pojo.User;
import com.cloud.test.usercustomerfegionhystrix.userFeignClient.UserFeign;
import com.cloud.test.usercustomerfegionhystrix.userFeignClient.UserFeign2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author HanLiBin
 * @version V1.0
 */
@RestController
public class UserController {


    @Autowired
    private UserFeign2 userFeign;

    @GetMapping("/movice/{id}")
    public User getUser(@PathVariable Integer id){
       return userFeign.getUser(id);
    }
//    public User fallbackgetUser(Integer id){
//        return  new User();
//    }
}
